<%-- 
    Document   : clani
    Created on : 28.6.2011, 1:09:45
    Author     : tincek
--%>

<%@page import="gandalf.model.Stranka"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.ArrayList"%>
<%@page import="gandalf.controller.StrankaJpaController"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <%StrankaJpaController strankaJpa = new StrankaJpaController();
                List<Stranka> clani = new ArrayList<Stranka>();
                String id = request.getParameter("id");
                if (id != null && id != "") {
                    long id1 = Long.parseLong(id);
                    strankaJpa.destroy(id1);
                }
                clani = strankaJpa.vrniVseClane(true);

    %>
    <body>
        <table>
            <tr>
                <th>Id</th>
                <th>Ime</th>
                <th>Priimek</th>
                <th>Email</th>
                <th>Naslov</th>
                <th>Narocen</th>
                <th>Opcije</th>
            </tr>
            <% for (Stranka s : clani) {%>
            <tr>
                <td><%=s.getId()%></td>
                <td><%=s.getIme()%></td>
                <td><%=s.getPriimek()%></td>
                <td><%=s.getEmail()%></td>
                <td><%=s.getNaslov()%></td>
                <td><%=s.isNarocen()%></td>

                <td>
                    <a href="vmesnik.jsp?Stran=clani.jsp?id=<%=s.getId()%>" class="example1" >
                        <img src="blueprint/plugins/buttons/icons/cross.png" alt="Zbrisi"/></a></td>
            </tr>

            <% }%>
        </table>
    </body>
</html>
